import { useLocation } from 'react-router-dom';

import FooterBlock from './footer';
import HeaderBlock from './header';

export default function CommonLayout({ children }: any) {
  const loca = useLocation();

  return (
    <div className="relative flex min-h-[100vh] w-full flex-col overflow-hidden text-[16px] text-[#363A44]">
      <HeaderBlock />
      <div className="pt-[150px]">{children}</div>
      {![/^\/editor/].some((r) => r.test(loca.pathname)) && <FooterBlock />}
    </div>
  );
}
